n=int(input())
a=list(map(int,input().split()))
k=int(input())

for _ in range(k):
    f = 0
    f2 = 0
    b=list(map(int,input().split()))
    for i in range(n):
        if a[i]==b[i] or b[i]==0:
            # 只要有一个人猜对
            if a[i]==b[i]:
                f=1
            f2+=1

    if f2==n and f:
        print("Da Jiang!!!")
    else:
        print("Ai Ya")